package ddd.calc;

import ddd.calc.R;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class Calculator extends Activity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}

	/**
	 * This gets called when a number is clicked
	 * 
	 * @param target
	 *            View that generated this event
	 */
	public void numClick(View target) {
		if (target instanceof Button) {
			Button btn = (Button) target;
			Log.d("Calculator.numClick", btn.getText().toString());
		}
	}

	/**
	 * This gets called when an operation is clicked, e.g. + - x /
	 * 
	 * @param target
	 *            View that generated this event
	 */
	public void opClick(View target) {
		if (target instanceof Button) {
			Button btn = (Button) target;
			Log.d("Calculator.opClick", btn.getText().toString());
		}
	}
}